Relationship to the Macintosh Toolbox
QuickDraw GX is in general designed to be platform independent. Within
the QuickDraw GX environment, the programming interface does not depend on
the existence of the Macintosh Toolbox or Macintosh hardware.However, when running on a Macintosh computer, QuickDraw GX still must have an interface with the Macintosh Toolbox. QuickDraw GX does not create windows, handle menus, receive keystrokes or automatically track mouse movements (although it
does support hit-testing). Therefore, for basic input and output needs, QuickDraw GX includes several sets of functions that carry information from the QuickDraw GX environment to the Macintosh world and back:
See the Macintosh environment chapter of Inside Macintosh: QuickDraw GX Environment and Utilities for information about these functions.
- You can associate QuickDraw GX view ports with Macintosh windows, which restricts a view port to the current size of the window and prevents drawing outside the content area of the window. QuickDraw GX and the Macintosh Window Manager then manage the view port for you such that, if the user moves the window, the view port moves too, or if the user changes the size of a window, the drawable area in the view port also changes.
- You can associate a QuickDraw GX view device with a Macintosh graphics device (
GDevice
).- You can translate coordinate locations, including mouse locations, between the integer-based QuickDraw global space and the fixed-point QuickDraw GX coordinate spaces.
- You can convert QuickDraw calls to QuickDraw GX calls, in two ways. You can use one set of functions to set up a situation whereby all QuickDraw calls are captured and converted to QuickDraw GX shapes in a QuickDraw GX picture. You can use another function to directly translate QuickDraw pictures to QuickDraw GX pictures.